package DataModel;

import java.util.ArrayList;
import java.util.Hashtable;

/**
 * This class represents an amino acid table with the different codon usage.
 * 
 * <br><br>
 * The different genetic codes are taken from:
 * <br>
 * <a href="http://www.ncbi.nlm.nih.gov/Taxonomy/Utils/wprintgc.cgi">http://www.ncbi.nlm.nih.gov/Taxonomy/Utils/wprintgc.cgi</a>
 * 
 * @author Stefan Lorenz
 * <br><b>Date:</b> 12.11.2012
 */
@SuppressWarnings({ "serial", "rawtypes" })
public class AminoAcidTable extends Hashtable {

    /**
     * Index of the selected translation table
     */
    private int translTable = 1;

    /**
     * List of all start codons
     */
    private ArrayList<String> startCodons;

    /**
     * List of all stop codons
     */
    private ArrayList<String> stopCodons;

    
    /**
     * Constructor of the amino acid table
     * @param transtable  the number of translation table
     */
    public AminoAcidTable(int transtable) {
	this.startCodons = new ArrayList<String>();
	this.stopCodons = new ArrayList<String>();
	setTranslTable(transtable);	
    }
    
    /**
     * Fills table with all codons 
     */
    @SuppressWarnings("unchecked")
    private void setCodonTable(){
	this.clear();
	if (this.translTable == 1) {
	    this.put("AGG", "R");
	    this.put("AGA", "R");
	    this.put("AGC", "S");
	    this.put("AGT", "S");
	    this.put("AAG", "K");
	    this.put("AAA", "K");
	    this.put("AAC", "N");
	    this.put("AAT", "N");
	    this.put("ACG", "T");
	    this.put("ACA", "T");
	    this.put("ACC", "T");
	    this.put("ACT", "T");
	    this.put("ATG", "M");
	    this.put("ATA", "I");
	    this.put("ATC", "I");
	    this.put("ATT", "I");
	    this.put("CGG", "R");
	    this.put("CGA", "R");
	    this.put("CGC", "R");
	    this.put("CGT", "R");
	    this.put("CAG", "Q");
	    this.put("CAA", "Q");
	    this.put("CAC", "H");
	    this.put("CAT", "H");
	    this.put("CCG", "P");
	    this.put("CCA", "P");
	    this.put("CCC", "P");
	    this.put("CCT", "P");
	    this.put("CTG", "L");
	    this.put("CTA", "L");
	    this.put("CTC", "L");
	    this.put("CTT", "L");
	    this.put("TGG", "W");
	    this.put("TGA", "");
	    this.put("TGC", "C");
	    this.put("TGT", "C");
	    this.put("TAG", "");
	    this.put("TAA", "");
	    this.put("TAC", "Y");
	    this.put("TAT", "Y");
	    this.put("TCG", "S");
	    this.put("TCA", "S");
	    this.put("TCC", "S");
	    this.put("TCT", "S");
	    this.put("TTG", "L");
	    this.put("TTA", "L");
	    this.put("TTC", "F");
	    this.put("TTT", "F");
	    this.put("GGG", "G");
	    this.put("GGA", "G");
	    this.put("GGC", "G");
	    this.put("GGT", "G");
	    this.put("GAG", "E");
	    this.put("GAA", "E");
	    this.put("GAC", "D");
	    this.put("GAT", "D");
	    this.put("GCG", "A");
	    this.put("GCA", "A");
	    this.put("GCC", "A");
	    this.put("GCT", "A");
	    this.put("GTG", "V");
	    this.put("GTA", "V");
	    this.put("GTC", "V");
	    this.put("GTT", "V");
	}
	if (this.translTable == 2) {
	    this.put("AGG", "");
	    this.put("AGA", "");
	    this.put("AGC", "S");
	    this.put("AGT", "S");
	    this.put("AAG", "K");
	    this.put("AAA", "K");
	    this.put("AAC", "N");
	    this.put("AAT", "N");
	    this.put("ACG", "T");
	    this.put("ACA", "T");
	    this.put("ACC", "T");
	    this.put("ACT", "T");
	    this.put("ATG", "M");
	    this.put("ATA", "M");
	    this.put("ATC", "I");
	    this.put("ATT", "I");
	    this.put("CGG", "R");
	    this.put("CGA", "R");
	    this.put("CGC", "R");
	    this.put("CGT", "R");
	    this.put("CAG", "Q");
	    this.put("CAA", "Q");
	    this.put("CAC", "H");
	    this.put("CAT", "H");
	    this.put("CCG", "P");
	    this.put("CCA", "P");
	    this.put("CCC", "P");
	    this.put("CCT", "P");
	    this.put("CTG", "L");
	    this.put("CTA", "L");
	    this.put("CTC", "L");
	    this.put("CTT", "L");
	    this.put("TGG", "W");
	    this.put("TGA", "W");
	    this.put("TGC", "C");
	    this.put("TGT", "C");
	    this.put("TAG", "");
	    this.put("TAA", "");
	    this.put("TAC", "Y");
	    this.put("TAT", "Y");
	    this.put("TCG", "S");
	    this.put("TCA", "S");
	    this.put("TCC", "S");
	    this.put("TCT", "S");
	    this.put("TTG", "L");
	    this.put("TTA", "L");
	    this.put("TTC", "F");
	    this.put("TTT", "F");
	    this.put("GGG", "G");
	    this.put("GGA", "G");
	    this.put("GGC", "G");
	    this.put("GGT", "G");
	    this.put("GAG", "E");
	    this.put("GAA", "E");
	    this.put("GAC", "D");
	    this.put("GAT", "D");
	    this.put("GCG", "A");
	    this.put("GCA", "A");
	    this.put("GCC", "A");
	    this.put("GCT", "A");
	    this.put("GTG", "V");
	    this.put("GTA", "V");
	    this.put("GTC", "V");
	    this.put("GTT", "V");
	}
	if (this.translTable == 3) {
	    this.put("AGG", "R");
	    this.put("AGA", "M");
	    this.put("AGC", "S");
	    this.put("AGT", "S");
	    this.put("AAG", "K");
	    this.put("AAA", "K");
	    this.put("AAC", "N");
	    this.put("AAT", "N");
	    this.put("ACG", "T");
	    this.put("ACA", "T");
	    this.put("ACC", "T");
	    this.put("ACT", "T");
	    this.put("ATG", "M");
	    this.put("ATA", "I");
	    this.put("ATC", "I");
	    this.put("ATT", "I");
	    this.put("CGG", "R");
	    this.put("CGT", "R");
	    this.put("CAG", "Q");
	    this.put("CAA", "Q");
	    this.put("CAC", "H");
	    this.put("CAT", "H");
	    this.put("CCG", "P");
	    this.put("CCA", "P");
	    this.put("CCC", "P");
	    this.put("CCT", "P");
	    this.put("CTG", "T");
	    this.put("CTA", "T");
	    this.put("CTC", "T");
	    this.put("CTT", "T");
	    this.put("TGG", "W");
	    this.put("TGA", "W");
	    this.put("TGC", "C");
	    this.put("TGT", "C");
	    this.put("TAG", "");
	    this.put("TAA", "");
	    this.put("TAC", "Y");
	    this.put("TAT", "Y");
	    this.put("TCG", "S");
	    this.put("TCA", "S");
	    this.put("TCC", "S");
	    this.put("TCT", "S");
	    this.put("TTG", "L");
	    this.put("TTA", "L");
	    this.put("TTC", "F");
	    this.put("TTT", "F");
	    this.put("GGG", "G");
	    this.put("GGA", "G");
	    this.put("GGC", "G");
	    this.put("GGT", "G");
	    this.put("GAG", "E");
	    this.put("GAA", "E");
	    this.put("GAC", "D");
	    this.put("GAT", "D");
	    this.put("GCG", "A");
	    this.put("GCA", "A");
	    this.put("GCC", "A");
	    this.put("GCT", "A");
	    this.put("GTG", "V");
	    this.put("GTA", "V");
	    this.put("GTC", "V");
	    this.put("GTT", "V");
	}
	if (this.translTable == 4) {
	    this.put("AGG", "R");
	    this.put("AGA", "R");
	    this.put("AGC", "S");
	    this.put("AGT", "S");
	    this.put("AAG", "K");
	    this.put("AAA", "K");
	    this.put("AAC", "N");
	    this.put("AAT", "N");
	    this.put("ACG", "T");
	    this.put("ACA", "T");
	    this.put("ACC", "T");
	    this.put("ACT", "T");
	    this.put("ATG", "M");
	    this.put("ATA", "I");
	    this.put("ATC", "I");
	    this.put("ATT", "I");
	    this.put("CGG", "R");
	    this.put("CGA", "R");
	    this.put("CGC", "R");
	    this.put("CGT", "R");
	    this.put("CAG", "Q");
	    this.put("CAA", "Q");
	    this.put("CAC", "H");
	    this.put("CAT", "H");
	    this.put("CCG", "P");
	    this.put("CCA", "P");
	    this.put("CCC", "P");
	    this.put("CCT", "P");
	    this.put("CTG", "L");
	    this.put("CTA", "L");
	    this.put("CTC", "L");
	    this.put("CTT", "L");
	    this.put("TGG", "W");
	    this.put("TGA", "W");
	    this.put("TGC", "C");
	    this.put("TGT", "C");
	    this.put("TAG", "");
	    this.put("TAA", "");
	    this.put("TAC", "Y");
	    this.put("TAT", "Y");
	    this.put("TCG", "S");
	    this.put("TCA", "S");
	    this.put("TCC", "S");
	    this.put("TCT", "S");
	    this.put("TTG", "L");
	    this.put("TTA", "L");
	    this.put("TTC", "F");
	    this.put("TTT", "F");
	    this.put("GGG", "G");
	    this.put("GGA", "G");
	    this.put("GGC", "G");
	    this.put("GGT", "G");
	    this.put("GAG", "E");
	    this.put("GAA", "E");
	    this.put("GAC", "D");
	    this.put("GAT", "D");
	    this.put("GCG", "A");
	    this.put("GCA", "A");
	    this.put("GCC", "A");
	    this.put("GCT", "A");
	    this.put("GTG", "V");
	    this.put("GTA", "V");
	    this.put("GTC", "V");
	    this.put("GTT", "V");
	}
	if (this.translTable == 5) {
	    this.put("AGG", "S");
	    this.put("AGA", "S");
	    this.put("AGC", "S");
	    this.put("AGT", "S");
	    this.put("AAG", "K");
	    this.put("AAA", "K");
	    this.put("AAC", "N");
	    this.put("AAT", "N");
	    this.put("ACG", "T");
	    this.put("ACA", "T");
	    this.put("ACC", "T");
	    this.put("ACT", "T");
	    this.put("ATG", "M");
	    this.put("ATA", "M");
	    this.put("ATC", "I");
	    this.put("ATT", "I");
	    this.put("CGG", "R");
	    this.put("CGA", "R");
	    this.put("CGC", "R");
	    this.put("CGT", "R");
	    this.put("CAG", "Q");
	    this.put("CAA", "Q");
	    this.put("CAC", "H");
	    this.put("CAT", "H");
	    this.put("CCG", "P");
	    this.put("CCA", "P");
	    this.put("CCC", "P");
	    this.put("CCT", "P");
	    this.put("CTG", "L");
	    this.put("CTA", "L");
	    this.put("CTC", "L");
	    this.put("CTT", "L");
	    this.put("TGG", "W");
	    this.put("TGA", "W");
	    this.put("TGC", "C");
	    this.put("TGT", "C");
	    this.put("TAG", "");
	    this.put("TAA", "");
	    this.put("TAC", "Y");
	    this.put("TAT", "Y");
	    this.put("TCG", "S");
	    this.put("TCA", "S");
	    this.put("TCC", "S");
	    this.put("TCT", "S");
	    this.put("TTG", "L");
	    this.put("TTA", "L");
	    this.put("TTC", "F");
	    this.put("TTT", "F");
	    this.put("GGG", "G");
	    this.put("GGA", "G");
	    this.put("GGC", "G");
	    this.put("GGT", "G");
	    this.put("GAG", "E");
	    this.put("GAA", "E");
	    this.put("GAC", "D");
	    this.put("GAT", "D");
	    this.put("GCG", "A");
	    this.put("GCA", "A");
	    this.put("GCC", "A");
	    this.put("GCT", "A");
	    this.put("GTG", "V");
	    this.put("GTA", "V");
	    this.put("GTC", "V");
	    this.put("GTT", "V");
	}
	if (this.translTable == 6) {
	    this.put("AGG", "R");
	    this.put("AGA", "R");
	    this.put("AGC", "S");
	    this.put("AGT", "S");
	    this.put("AAG", "K");
	    this.put("AAA", "K");
	    this.put("AAC", "N");
	    this.put("AAT", "N");
	    this.put("ACG", "T");
	    this.put("ACA", "T");
	    this.put("ACC", "T");
	    this.put("ACT", "T");
	    this.put("ATG", "M");
	    this.put("ATA", "I");
	    this.put("ATC", "I");
	    this.put("ATT", "I");
	    this.put("CGG", "R");
	    this.put("CGA", "R");
	    this.put("CGC", "R");
	    this.put("CGT", "R");
	    this.put("CAG", "Q");
	    this.put("CAA", "Q");
	    this.put("CAC", "H");
	    this.put("CAT", "H");
	    this.put("CCG", "P");
	    this.put("CCA", "P");
	    this.put("CCC", "P");
	    this.put("CCT", "P");
	    this.put("CTG", "L");
	    this.put("CTA", "L");
	    this.put("CTC", "L");
	    this.put("CTT", "L");
	    this.put("TGG", "W");
	    this.put("TGA", "");
	    this.put("TGC", "C");
	    this.put("TGT", "C");
	    this.put("TAG", "Q");
	    this.put("TAA", "Q");
	    this.put("TAC", "Y");
	    this.put("TAT", "Y");
	    this.put("TCG", "S");
	    this.put("TCA", "S");
	    this.put("TCC", "S");
	    this.put("TCT", "S");
	    this.put("TTG", "L");
	    this.put("TTA", "L");
	    this.put("TTC", "F");
	    this.put("TTT", "F");
	    this.put("GGG", "G");
	    this.put("GGA", "G");
	    this.put("GGC", "G");
	    this.put("GGT", "G");
	    this.put("GAG", "E");
	    this.put("GAA", "E");
	    this.put("GAC", "D");
	    this.put("GAT", "D");
	    this.put("GCG", "A");
	    this.put("GCA", "A");
	    this.put("GCC", "A");
	    this.put("GCT", "A");
	    this.put("GTG", "V");
	    this.put("GTA", "V");
	    this.put("GTC", "V");
	    this.put("GTT", "V");
	}
	if (this.translTable == 9) {
	    this.put("AGG", "S");
	    this.put("AGA", "S");
	    this.put("AGC", "S");
	    this.put("AGT", "S");
	    this.put("AAG", "K");
	    this.put("AAA", "N");
	    this.put("AAC", "N");
	    this.put("AAT", "N");
	    this.put("ACG", "T");
	    this.put("ACA", "T");
	    this.put("ACC", "T");
	    this.put("ACT", "T");
	    this.put("ATG", "M");
	    this.put("ATA", "I");
	    this.put("ATC", "I");
	    this.put("ATT", "I");
	    this.put("CGG", "R");
	    this.put("CGA", "R");
	    this.put("CGC", "R");
	    this.put("CGT", "R");
	    this.put("CAG", "Q");
	    this.put("CAA", "Q");
	    this.put("CAC", "H");
	    this.put("CAT", "H");
	    this.put("CCG", "P");
	    this.put("CCA", "P");
	    this.put("CCC", "P");
	    this.put("CCT", "P");
	    this.put("CTG", "L");
	    this.put("CTA", "L");
	    this.put("CTC", "L");
	    this.put("CTT", "L");
	    this.put("TGG", "W");
	    this.put("TGA", "W");
	    this.put("TGC", "C");
	    this.put("TGT", "C");
	    this.put("TAG", "");
	    this.put("TAA", "");
	    this.put("TAC", "Y");
	    this.put("TAT", "Y");
	    this.put("TCG", "S");
	    this.put("TCA", "S");
	    this.put("TCC", "S");
	    this.put("TCT", "S");
	    this.put("TTG", "L");
	    this.put("TTA", "L");
	    this.put("TTC", "F");
	    this.put("TTT", "F");
	    this.put("GGG", "G");
	    this.put("GGA", "G");
	    this.put("GGC", "G");
	    this.put("GGT", "G");
	    this.put("GAG", "E");
	    this.put("GAA", "E");
	    this.put("GAC", "D");
	    this.put("GAT", "D");
	    this.put("GCG", "A");
	    this.put("GCA", "A");
	    this.put("GCC", "A");
	    this.put("GCT", "A");
	    this.put("GTG", "V");
	    this.put("GTA", "V");
	    this.put("GTC", "V");
	    this.put("GTT", "V");
	}
	if (this.translTable == 10) {
	    this.put("AGG", "R");
	    this.put("AGA", "R");
	    this.put("AGC", "S");
	    this.put("AGT", "S");
	    this.put("AAG", "K");
	    this.put("AAA", "K");
	    this.put("AAC", "N");
	    this.put("AAT", "N");
	    this.put("ACG", "T");
	    this.put("ACA", "T");
	    this.put("ACC", "T");
	    this.put("ACT", "T");
	    this.put("ATG", "M");
	    this.put("ATA", "I");
	    this.put("ATC", "I");
	    this.put("ATT", "I");
	    this.put("CGG", "R");
	    this.put("CGA", "R");
	    this.put("CGC", "R");
	    this.put("CGT", "R");
	    this.put("CAG", "Q");
	    this.put("CAA", "Q");
	    this.put("CAC", "H");
	    this.put("CAT", "H");
	    this.put("CCG", "P");
	    this.put("CCA", "P");
	    this.put("CCC", "P");
	    this.put("CCT", "P");
	    this.put("CTG", "L");
	    this.put("CTA", "L");
	    this.put("CTC", "L");
	    this.put("CTT", "L");
	    this.put("TGG", "W");
	    this.put("TGA", "C");
	    this.put("TGC", "C");
	    this.put("TGT", "C");
	    this.put("TAG", "");
	    this.put("TAA", "");
	    this.put("TAC", "Y");
	    this.put("TAT", "Y");
	    this.put("TCG", "S");
	    this.put("TCA", "S");
	    this.put("TCC", "S");
	    this.put("TCT", "S");
	    this.put("TTG", "L");
	    this.put("TTA", "L");
	    this.put("TTC", "F");
	    this.put("TTT", "F");
	    this.put("GGG", "G");
	    this.put("GGA", "G");
	    this.put("GGC", "G");
	    this.put("GGT", "G");
	    this.put("GAG", "E");
	    this.put("GAA", "E");
	    this.put("GAC", "D");
	    this.put("GAT", "D");
	    this.put("GCG", "A");
	    this.put("GCA", "A");
	    this.put("GCC", "A");
	    this.put("GCT", "A");
	    this.put("GTG", "V");
	    this.put("GTA", "V");
	    this.put("GTC", "V");
	    this.put("GTT", "V");
	}
	if (this.translTable == 11) {
	    this.put("AGG", "R");
	    this.put("AGA", "R");
	    this.put("AGC", "S");
	    this.put("AGT", "S");
	    this.put("AAG", "K");
	    this.put("AAA", "K");
	    this.put("AAC", "N");
	    this.put("AAT", "N");
	    this.put("ACG", "T");
	    this.put("ACA", "T");
	    this.put("ACC", "T");
	    this.put("ACT", "T");
	    this.put("ATG", "M");
	    this.put("ATA", "I");
	    this.put("ATC", "I");
	    this.put("ATT", "I");
	    this.put("CGG", "R");
	    this.put("CGA", "R");
	    this.put("CGC", "R");
	    this.put("CGT", "R");
	    this.put("CAG", "Q");
	    this.put("CAA", "Q");
	    this.put("CAC", "H");
	    this.put("CAT", "H");
	    this.put("CCG", "P");
	    this.put("CCA", "P");
	    this.put("CCC", "P");
	    this.put("CCT", "P");
	    this.put("CTG", "L");
	    this.put("CTA", "L");
	    this.put("CTC", "L");
	    this.put("CTT", "L");
	    this.put("TGG", "W");
	    this.put("TGA", "");
	    this.put("TGC", "C");
	    this.put("TGT", "C");
	    this.put("TAG", "");
	    this.put("TAA", "");
	    this.put("TAC", "Y");
	    this.put("TAT", "Y");
	    this.put("TCG", "S");
	    this.put("TCA", "S");
	    this.put("TCC", "S");
	    this.put("TCT", "S");
	    this.put("TTG", "L");
	    this.put("TTA", "L");
	    this.put("TTC", "F");
	    this.put("TTT", "F");
	    this.put("GGG", "G");
	    this.put("GGA", "G");
	    this.put("GGC", "G");
	    this.put("GGT", "G");
	    this.put("GAG", "E");
	    this.put("GAA", "E");
	    this.put("GAC", "D");
	    this.put("GAT", "D");
	    this.put("GCG", "A");
	    this.put("GCA", "A");
	    this.put("GCC", "A");
	    this.put("GCT", "A");
	    this.put("GTG", "V");
	    this.put("GTA", "V");
	    this.put("GTC", "V");
	    this.put("GTT", "V");
	}
	if (this.translTable == 12) {
	    this.put("AGG", "R");
	    this.put("AGA", "R");
	    this.put("AGC", "S");
	    this.put("AGT", "S");
	    this.put("AAG", "K");
	    this.put("AAA", "K");
	    this.put("AAC", "N");
	    this.put("AAT", "N");
	    this.put("ACG", "T");
	    this.put("ACA", "T");
	    this.put("ACC", "T");
	    this.put("ACT", "T");
	    this.put("ATG", "M");
	    this.put("ATA", "I");
	    this.put("ATC", "I");
	    this.put("ATT", "I");
	    this.put("CGG", "R");
	    this.put("CGA", "R");
	    this.put("CGC", "R");
	    this.put("CGT", "R");
	    this.put("CAG", "Q");
	    this.put("CAA", "Q");
	    this.put("CAC", "H");
	    this.put("CAT", "H");
	    this.put("CCG", "P");
	    this.put("CCA", "P");
	    this.put("CCC", "P");
	    this.put("CCT", "P");
	    this.put("CTG", "S");
	    this.put("CTA", "L");
	    this.put("CTC", "L");
	    this.put("CTT", "L");
	    this.put("TGG", "W");
	    this.put("TGA", "");
	    this.put("TGC", "C");
	    this.put("TGT", "C");
	    this.put("TAG", "");
	    this.put("TAA", "");
	    this.put("TAC", "Y");
	    this.put("TAT", "Y");
	    this.put("TCG", "S");
	    this.put("TCA", "S");
	    this.put("TCC", "S");
	    this.put("TCT", "S");
	    this.put("TTG", "L");
	    this.put("TTA", "L");
	    this.put("TTC", "F");
	    this.put("TTT", "F");
	    this.put("GGG", "G");
	    this.put("GGA", "G");
	    this.put("GGC", "G");
	    this.put("GGT", "G");
	    this.put("GAG", "E");
	    this.put("GAA", "E");
	    this.put("GAC", "D");
	    this.put("GAT", "D");
	    this.put("GCG", "A");
	    this.put("GCA", "A");
	    this.put("GCC", "A");
	    this.put("GCT", "A");
	    this.put("GTG", "V");
	    this.put("GTA", "V");
	    this.put("GTC", "V");
	    this.put("GTT", "V");
	}
	if (this.translTable == 13) {
	    this.put("AGG", "G");
	    this.put("AGA", "G");
	    this.put("AGC", "S");
	    this.put("AGT", "S");
	    this.put("AAG", "K");
	    this.put("AAA", "K");
	    this.put("AAC", "N");
	    this.put("AAT", "N");
	    this.put("ACG", "T");
	    this.put("ACA", "T");
	    this.put("ACC", "T");
	    this.put("ACT", "T");
	    this.put("ATG", "M");
	    this.put("ATA", "M");
	    this.put("ATC", "I");
	    this.put("ATT", "I");
	    this.put("CGG", "R");
	    this.put("CGA", "R");
	    this.put("CGC", "R");
	    this.put("CGT", "R");
	    this.put("CAG", "Q");
	    this.put("CAA", "Q");
	    this.put("CAC", "H");
	    this.put("CAT", "H");
	    this.put("CCG", "P");
	    this.put("CCA", "P");
	    this.put("CCC", "P");
	    this.put("CCT", "P");
	    this.put("CTG", "L");
	    this.put("CTA", "L");
	    this.put("CTC", "L");
	    this.put("CTT", "L");
	    this.put("TGG", "W");
	    this.put("TGA", "W");
	    this.put("TGC", "C");
	    this.put("TGT", "C");
	    this.put("TAG", "");
	    this.put("TAA", "");
	    this.put("TAC", "Y");
	    this.put("TAT", "Y");
	    this.put("TCG", "S");
	    this.put("TCA", "S");
	    this.put("TCC", "S");
	    this.put("TCT", "S");
	    this.put("TTG", "L");
	    this.put("TTA", "L");
	    this.put("TTC", "F");
	    this.put("TTT", "F");
	    this.put("GGG", "G");
	    this.put("GGA", "G");
	    this.put("GGC", "G");
	    this.put("GGT", "G");
	    this.put("GAG", "E");
	    this.put("GAA", "E");
	    this.put("GAC", "D");
	    this.put("GAT", "D");
	    this.put("GCG", "A");
	    this.put("GCA", "A");
	    this.put("GCC", "A");
	    this.put("GCT", "A");
	    this.put("GTG", "V");
	    this.put("GTA", "V");
	    this.put("GTC", "V");
	    this.put("GTT", "V");
	}
	if (this.translTable == 14) {
	    this.put("AGG", "S");
	    this.put("AGA", "S");
	    this.put("AGC", "S");
	    this.put("AGT", "S");
	    this.put("AAG", "K");
	    this.put("AAA", "N");
	    this.put("AAC", "N");
	    this.put("AAT", "N");
	    this.put("ACG", "T");
	    this.put("ACA", "T");
	    this.put("ACC", "T");
	    this.put("ACT", "T");
	    this.put("ATG", "M");
	    this.put("ATA", "I");
	    this.put("ATC", "I");
	    this.put("ATT", "I");
	    this.put("CGG", "R");
	    this.put("CGA", "R");
	    this.put("CGC", "R");
	    this.put("CGT", "R");
	    this.put("CAG", "Q");
	    this.put("CAA", "Q");
	    this.put("CAC", "H");
	    this.put("CAT", "H");
	    this.put("CCG", "P");
	    this.put("CCA", "P");
	    this.put("CCC", "P");
	    this.put("CCT", "P");
	    this.put("CTG", "L");
	    this.put("CTA", "L");
	    this.put("CTC", "L");
	    this.put("CTT", "L");
	    this.put("TGG", "W");
	    this.put("TGA", "W");
	    this.put("TGC", "C");
	    this.put("TGT", "C");
	    this.put("TAG", "");
	    this.put("TAA", "Y");
	    this.put("TAC", "Y");
	    this.put("TAT", "Y");
	    this.put("TCG", "S");
	    this.put("TCA", "S");
	    this.put("TCC", "S");
	    this.put("TCT", "S");
	    this.put("TTG", "L");
	    this.put("TTA", "L");
	    this.put("TTC", "F");
	    this.put("TTT", "F");
	    this.put("GGG", "G");
	    this.put("GGA", "G");
	    this.put("GGC", "G");
	    this.put("GGT", "G");
	    this.put("GAG", "E");
	    this.put("GAA", "E");
	    this.put("GAC", "D");
	    this.put("GAT", "D");
	    this.put("GCG", "A");
	    this.put("GCA", "A");
	    this.put("GCC", "A");
	    this.put("GCT", "A");
	    this.put("GTG", "V");
	    this.put("GTA", "V");
	    this.put("GTC", "V");
	    this.put("GTT", "V");
	}
	if (this.translTable == 15) {
	    this.put("AGG", "R");
	    this.put("AGA", "R");
	    this.put("AGC", "S");
	    this.put("AGT", "S");
	    this.put("AAG", "K");
	    this.put("AAA", "K");
	    this.put("AAC", "N");
	    this.put("AAT", "N");
	    this.put("ACG", "T");
	    this.put("ACA", "T");
	    this.put("ACC", "T");
	    this.put("ACT", "T");
	    this.put("ATG", "M");
	    this.put("ATA", "I");
	    this.put("ATC", "I");
	    this.put("ATT", "I");
	    this.put("CGG", "R");
	    this.put("CGA", "R");
	    this.put("CGC", "R");
	    this.put("CGT", "R");
	    this.put("CAG", "Q");
	    this.put("CAA", "Q");
	    this.put("CAC", "H");
	    this.put("CAT", "H");
	    this.put("CCG", "P");
	    this.put("CCA", "P");
	    this.put("CCC", "P");
	    this.put("CCT", "P");
	    this.put("CTG", "L");
	    this.put("CTA", "L");
	    this.put("CTC", "L");
	    this.put("CTT", "L");
	    this.put("TGG", "W");
	    this.put("TGA", "");
	    this.put("TGC", "C");
	    this.put("TGT", "C");
	    this.put("TAG", "Q");
	    this.put("TAA", "");
	    this.put("TAC", "Y");
	    this.put("TAT", "Y");
	    this.put("TCG", "S");
	    this.put("TCA", "S");
	    this.put("TCC", "S");
	    this.put("TCT", "S");
	    this.put("TTG", "L");
	    this.put("TTA", "L");
	    this.put("TTC", "F");
	    this.put("TTT", "F");
	    this.put("GGG", "G");
	    this.put("GGA", "G");
	    this.put("GGC", "G");
	    this.put("GGT", "G");
	    this.put("GAG", "E");
	    this.put("GAA", "E");
	    this.put("GAC", "D");
	    this.put("GAT", "D");
	    this.put("GCG", "A");
	    this.put("GCA", "A");
	    this.put("GCC", "A");
	    this.put("GCT", "A");
	    this.put("GTG", "V");
	    this.put("GTA", "V");
	    this.put("GTC", "V");
	    this.put("GTT", "V");
	}
	if (this.translTable == 16) {
	    this.put("AGG", "R");
	    this.put("AGA", "R");
	    this.put("AGC", "S");
	    this.put("AGT", "S");
	    this.put("AAG", "K");
	    this.put("AAA", "K");
	    this.put("AAC", "N");
	    this.put("AAT", "N");
	    this.put("ACG", "T");
	    this.put("ACA", "T");
	    this.put("ACC", "T");
	    this.put("ACT", "T");
	    this.put("ATG", "M");
	    this.put("ATA", "I");
	    this.put("ATC", "I");
	    this.put("ATT", "I");
	    this.put("CGG", "R");
	    this.put("CGA", "R");
	    this.put("CGC", "R");
	    this.put("CGT", "R");
	    this.put("CAG", "Q");
	    this.put("CAA", "Q");
	    this.put("CAC", "H");
	    this.put("CAT", "H");
	    this.put("CCG", "P");
	    this.put("CCA", "P");
	    this.put("CCC", "P");
	    this.put("CCT", "P");
	    this.put("CTG", "L");
	    this.put("CTA", "L");
	    this.put("CTC", "L");
	    this.put("CTT", "L");
	    this.put("TGG", "W");
	    this.put("TGA", "");
	    this.put("TGC", "C");
	    this.put("TGT", "C");
	    this.put("TAG", "L");
	    this.put("TAA", "");
	    this.put("TAC", "Y");
	    this.put("TAT", "Y");
	    this.put("TCG", "S");
	    this.put("TCA", "S");
	    this.put("TCC", "S");
	    this.put("TCT", "S");
	    this.put("TTG", "L");
	    this.put("TTA", "L");
	    this.put("TTC", "F");
	    this.put("TTT", "F");
	    this.put("GGG", "G");
	    this.put("GGA", "G");
	    this.put("GGC", "G");
	    this.put("GGT", "G");
	    this.put("GAG", "E");
	    this.put("GAA", "E");
	    this.put("GAC", "D");
	    this.put("GAT", "D");
	    this.put("GCG", "A");
	    this.put("GCA", "A");
	    this.put("GCC", "A");
	    this.put("GCT", "A");
	    this.put("GTG", "V");
	    this.put("GTA", "V");
	    this.put("GTC", "V");
	    this.put("GTT", "V");
	}
	if (this.translTable == 21) {
	    this.put("AGG", "S");
	    this.put("AGA", "S");
	    this.put("AGC", "S");
	    this.put("AGT", "S");
	    this.put("AAG", "K");
	    this.put("AAA", "N");
	    this.put("AAC", "N");
	    this.put("AAT", "N");
	    this.put("ACG", "T");
	    this.put("ACA", "T");
	    this.put("ACC", "T");
	    this.put("ACT", "T");
	    this.put("ATG", "M");
	    this.put("ATA", "M");
	    this.put("ATC", "I");
	    this.put("ATT", "I");
	    this.put("CGG", "R");
	    this.put("CGA", "R");
	    this.put("CGC", "R");
	    this.put("CGT", "R");
	    this.put("CAG", "Q");
	    this.put("CAA", "Q");
	    this.put("CAC", "H");
	    this.put("CAT", "H");
	    this.put("CCG", "P");
	    this.put("CCA", "P");
	    this.put("CCC", "P");
	    this.put("CCT", "P");
	    this.put("CTG", "L");
	    this.put("CTA", "L");
	    this.put("CTC", "L");
	    this.put("CTT", "L");
	    this.put("TGG", "W");
	    this.put("TGA", "W");
	    this.put("TGC", "C");
	    this.put("TGT", "C");
	    this.put("TAG", "");
	    this.put("TAA", "");
	    this.put("TAC", "Y");
	    this.put("TAT", "Y");
	    this.put("TCG", "S");
	    this.put("TCA", "S");
	    this.put("TCC", "S");
	    this.put("TCT", "S");
	    this.put("TTG", "L");
	    this.put("TTA", "L");
	    this.put("TTC", "F");
	    this.put("TTT", "F");
	    this.put("GGG", "G");
	    this.put("GGA", "G");
	    this.put("GGC", "G");
	    this.put("GGT", "G");
	    this.put("GAG", "E");
	    this.put("GAA", "E");
	    this.put("GAC", "D");
	    this.put("GAT", "D");
	    this.put("GCG", "A");
	    this.put("GCA", "A");
	    this.put("GCC", "A");
	    this.put("GCT", "A");
	    this.put("GTG", "V");
	    this.put("GTA", "V");
	    this.put("GTC", "V");
	    this.put("GTT", "V");
	}
	if (this.translTable == 22) {
	    this.put("AGG", "R");
	    this.put("AGA", "R");
	    this.put("AGC", "S");
	    this.put("AGT", "S");
	    this.put("AAG", "K");
	    this.put("AAA", "K");
	    this.put("AAC", "N");
	    this.put("AAT", "N");
	    this.put("ACG", "T");
	    this.put("ACA", "T");
	    this.put("ACC", "T");
	    this.put("ACT", "T");
	    this.put("ATG", "M");
	    this.put("ATA", "I");
	    this.put("ATC", "I");
	    this.put("ATT", "I");
	    this.put("CGG", "R");
	    this.put("CGA", "R");
	    this.put("CGC", "R");
	    this.put("CGT", "R");
	    this.put("CAG", "Q");
	    this.put("CAA", "Q");
	    this.put("CAC", "H");
	    this.put("CAT", "H");
	    this.put("CCG", "P");
	    this.put("CCA", "P");
	    this.put("CCC", "P");
	    this.put("CCT", "P");
	    this.put("CTG", "L");
	    this.put("CTA", "L");
	    this.put("CTC", "L");
	    this.put("CTT", "L");
	    this.put("TGG", "W");
	    this.put("TGA", "");
	    this.put("TGC", "C");
	    this.put("TGT", "C");
	    this.put("TAG", "L");
	    this.put("TAA", "");
	    this.put("TAC", "Y");
	    this.put("TAT", "Y");
	    this.put("TCG", "S");
	    this.put("TCA", "");
	    this.put("TCC", "S");
	    this.put("TCT", "S");
	    this.put("TTG", "L");
	    this.put("TTA", "L");
	    this.put("TTC", "F");
	    this.put("TTT", "F");
	    this.put("GGG", "G");
	    this.put("GGA", "G");
	    this.put("GGC", "G");
	    this.put("GGT", "G");
	    this.put("GAG", "E");
	    this.put("GAA", "E");
	    this.put("GAC", "D");
	    this.put("GAT", "D");
	    this.put("GCG", "A");
	    this.put("GCA", "A");
	    this.put("GCC", "A");
	    this.put("GCT", "A");
	    this.put("GTG", "V");
	    this.put("GTA", "V");
	    this.put("GTC", "V");
	    this.put("GTT", "V");
	}
	if (this.translTable == 24) {
	    this.put("AGG", "K");
	    this.put("AGA", "S");
	    this.put("AGC", "S");
	    this.put("AGT", "S");
	    this.put("AAG", "K");
	    this.put("AAA", "K");
	    this.put("AAC", "N");
	    this.put("AAT", "N");
	    this.put("ACG", "T");
	    this.put("ACA", "T");
	    this.put("ACC", "T");
	    this.put("ACT", "T");
	    this.put("ATG", "M");
	    this.put("ATA", "I");
	    this.put("ATC", "I");
	    this.put("ATT", "I");
	    this.put("CGG", "R");
	    this.put("CGA", "R");
	    this.put("CGC", "R");
	    this.put("CGT", "R");
	    this.put("CAG", "Q");
	    this.put("CAA", "Q");
	    this.put("CAC", "H");
	    this.put("CAT", "H");
	    this.put("CCG", "P");
	    this.put("CCA", "P");
	    this.put("CCC", "P");
	    this.put("CCT", "P");
	    this.put("CTG", "L");
	    this.put("CTA", "L");
	    this.put("CTC", "L");
	    this.put("CTT", "L");
	    this.put("TGG", "W");
	    this.put("TGA", "W");
	    this.put("TGC", "C");
	    this.put("TGT", "C");
	    this.put("TAG", "");
	    this.put("TAA", "");
	    this.put("TAC", "Y");
	    this.put("TAT", "Y");
	    this.put("TCG", "S");
	    this.put("TCA", "S");
	    this.put("TCC", "S");
	    this.put("TCT", "S");
	    this.put("TTG", "L");
	    this.put("TTA", "L");
	    this.put("TTC", "F");
	    this.put("TTT", "F");
	    this.put("GGG", "G");
	    this.put("GGA", "G");
	    this.put("GGC", "G");
	    this.put("GGT", "G");
	    this.put("GAG", "E");
	    this.put("GAA", "E");
	    this.put("GAC", "D");
	    this.put("GAT", "D");
	    this.put("GCG", "A");
	    this.put("GCA", "A");
	    this.put("GCC", "A");
	    this.put("GCT", "A");
	    this.put("GTG", "V");
	    this.put("GTA", "V");
	    this.put("GTC", "V");
	    this.put("GTT", "V");
	}
    }

    
    /**
     * Add start and stop codons
     */
    private void setStartStopCodons() {
	this.startCodons.clear();
	this.stopCodons.clear();
	switch (this.translTable) {
	case 1:
	    this.startCodons.add("ATG");
	    this.stopCodons.add("TGA");
	    this.stopCodons.add("TAG");
	    this.stopCodons.add("TAA");
	    break;
	case 2:
	    this.startCodons.add("ATG");
	    this.startCodons.add("ATA");
	    this.stopCodons.add("AGG");
	    this.stopCodons.add("AGA");
	    this.stopCodons.add("TAG");
	    this.stopCodons.add("TAA");
	    break;
	case 3:
	    this.startCodons.add("AGA");
	    this.startCodons.add("ATG");
	    this.stopCodons.add("TAG");
	    this.stopCodons.add("TAA");
	    break;
	case 4:
	    this.startCodons.add("ATG");
	    this.stopCodons.add("TAG");
	    this.stopCodons.add("TAA");
	    break;
	case 5:
	    this.startCodons.add("ATG");
	    this.startCodons.add("ATA");
	    this.stopCodons.add("TAG");
	    this.stopCodons.add("TAA");
	    break;
	case 6:
	    this.startCodons.add("ATG");
	    this.stopCodons.add("TGA");
	    break;
	case 9:
	    this.startCodons.add("ATG");
	    this.stopCodons.add("TAG");
	    this.stopCodons.add("TAA");
	    break;
	case 10:
	    this.startCodons.add("ATG");
	    this.stopCodons.add("TAG");
	    this.stopCodons.add("TAA");
	    break;
	case 11:
	    this.startCodons.add("ATG");
	    this.stopCodons.add("TAG");
	    this.stopCodons.add("TAA");
	    this.stopCodons.add("TGA");
	    break;
	case 12:
	    this.startCodons.add("ATG");
	    this.stopCodons.add("TGA");
	    this.stopCodons.add("TAA");
	    this.stopCodons.add("TAG");
	    break;
	case 13:
	    this.startCodons.add("ATG");
	    this.startCodons.add("ATA");
	    this.stopCodons.add("TAG");
	    this.stopCodons.add("TAA");
	    break;
	case 14:
	    this.startCodons.add("ATG");
	    this.stopCodons.add("TAG");
	    break;
	case 15:
	    this.startCodons.add("ATG");
	    this.stopCodons.add("TGA");
	    this.stopCodons.add("TAA");
	    break;
	case 16:
	    this.startCodons.add("ATG");
	    this.stopCodons.add("TGA");
	    this.stopCodons.add("TAA");
	    break;
	case 21:
	    this.startCodons.add("ATG");
	    this.startCodons.add("ATA");
	    this.stopCodons.add("TAG");
	    this.stopCodons.add("TAA");
	    break;
	case 22:
	    this.startCodons.add("ATG");
	    this.stopCodons.add("TGA");
	    this.stopCodons.add("TAA");
	    this.stopCodons.add("TCA");
	    break;
	case 24:
	    this.startCodons.add("ATG");
	    this.stopCodons.add("TAG");
	    this.stopCodons.add("TAA");
	    break;
	default:
	    break;
	}
    }


    /**
     * Returns all stop codons
     * @return {@link ArrayList} with all start codons
     */
    public ArrayList<String> getStartCodons() {
	return startCodons;
    }

    /**
     * Returns all stop codons
     * @return {@link ArrayList} with all stop codons
     */
    public ArrayList<String> getStopCodons() {
	return stopCodons;
    }
    
    /**
     * Sets the translation table and adopt the codon usage 
     * @param translTable the number of the translation table
     */
    public void setTranslTable(int translTable) {
	this.translTable = translTable;
	setStartStopCodons();
	setCodonTable();
    }

    /**
     * Returns the translation table number which is choosen
     * @return {@link Integer} which represents the number of the translation table
     */
    public int getTranslTable() {
	return this.translTable;
    }
}
